package net.asfun.jvalog.service;

import java.util.ArrayList;
import java.util.List;

import net.asfun.jvalog.common.JdoerFactory;
import net.asfun.jvalog.entity.Map;
import net.asfun.jvalog.resource.MapDao;
import net.asfun.jvalog.util.UpdateManager;
import net.asfun.jvalog.vo.Config;


public class ConfigService {

	
	public static List<Config> listAll() {
		List<Config> configs = new ArrayList<Config>();
		for( Map map : MapDao.listAll() ) {
			configs.add(new Config(map));
		}
		return configs;
	}

	public static void update(Long id, String value) {
		Map map = JdoerFactory.jdoMap.load(id);
		map.setValue(value);
		UpdateManager.enableStaticTask();
	}
	
}
